<?php

// Load the Zend framework
require_once 'Zend/Loader.php';

// Load the Delicious object
Zend_Loader::loadClass('Zend_Service_Delicious');

// Grab the username and password
$username = strip_tags($_GET["username"]);
$password = strip_tags($_GET["password"]);

// Authenticate with Delicious
$delicious = new Zend_Service_Delicious($username, $password);

$res = $delicious->getTags();

echo 'var delicious_tagsavail = [';
  foreach ($res as $key => $value) {
    echo '"'.$key.'",';
  }
echo '];';
?>
